package com.ds.lens.data.common.query;

import java.lang.reflect.Type;

public class DateHistogramFunction implements MQLFunction {
    private static final DateHistogramFunction INSTANCE = new DateHistogramFunction();
    private DateHistogramFunction(){}
    @Override
    public String getFunctionName() {
        return "date_histogram";
    }

    @Override
    public Type[] getParameterTypes() {
        return new Type[]{String.class, String.class};
    }

    @Override
    public String getExpression(Object... params) {
        return getFunctionName() + "(" + params[0] + ", '" + params[1] + "')";
    }

    public static DateHistogramFunction get() {
        return INSTANCE;
    }
}
